Version 3.0
User's Guide

Commands: Client Type

Previous | Next
Contents

<INSERT_CLIENT>

This command will place the name of the user's Web browser, as text, into your document at the specified point. The browser name is defined by the browser itself.

Here is an example:

    Your Web browser is <INSERT_CLIENT>.

<HIDE_CLIENT operator client1 client2 ...>
<SHOW_CLIENT operator client1 client2 ...>

HIDE_CLIENT hides the HTML text from clients using any Web browser that satisfies the comparison operator. SHOW_CLIENT shows text to those clients.

These commands are most commonly used to tailor elements of a page to match the features of particular browsers. They actually work on the identification string that the browser sends with each request, which may not exactly match the browser's name. The two most popular browsers, Netscape Navigator and Internet Explorer, each have some peculiarities.

"Web crawlers" or "spiders" from search engines such as Excite or HotBot also identify themselves the same way that browsers do. The identification string frequently also includes the version number and platform of the browser or spider. This information creates additional uses for HIDE_CLIENT, allowing you to provide special content to Web robots that will control which links on your site are crawled or optimize their index of your pages.

The comparison operator is optional. If omitted, NetCloak performs a "contains" comparison, which means that any browser whose identification string contains any of the text parameters will satisfy the command.

Navigator identifies itself as "Mozilla", not "Navigator" or "Netscape". This is further complicated by the fact that most versions of Internet Explorer also identify themselves as "Mozilla", followed by "compatible" and "MSIE". Differentiating the two is no problem with NetCloak, but requires a bit of extra work. Here are the identifications of some common browsers:

    Mozilla/2.0 (compatible;MSIE 2.1;Mac_PowerPC)
    Mozilla/2.0 (compatible;MSIE 3.0;Mac_PowerPC)
    Mozilla/3.0 (compatible;MSIE 4.0;Mac_PowerPC)
    Mozilla/2.0 (Macintosh; I; PPC)
    Mozilla/3.0 (Macintosh; I; PPC)
    Mozilla/4.03 (Macintosh; U; PPC)

To distinguish Navigator and Explorer (not to mention other Netscape "compatible" browsers), simply add an extra "HIDE" or "SHOW" to check for the word "compatible", as in:

    You are using
    <HIDE>    <SHOW_CLIENT Mozilla>    <HIDE_CLIENT compatible>Netscape Navigator
    <HIDE><SHOW_CLIENT MSIE>Internet Explorer
    <SHOW>

When using a "contains" text comparison, there is no need to specify the entire browser name. It is best to specify enough of the browser name to uniquely identify it without specifying so much that different versions of the same browser are treated differently (unless that is the desired effect). For example, to hide a portion of your HTML document from Navigator clients, you would probably just use:

    <HIDE_CLIENT CONTAINS Mozilla>

To specify a particular version, you could use something similar to:

    <HIDE_CLIENT CONTAINS Mozilla/2>

Since the name specified in the command can appear anywhere in the identification, you can use it to match other information in the string. For example, the Macintosh version of most browsers include "Mac" in their name, so you can use the HIDE_CLIENT command to customize your pages for Macintosh clients. To hide text from Macintosh browsers, you can simply use:

    <HIDE_CLIENT CONTAINS Mac>.

Unfortunately, it is impossible to give a complete list of Web browser identifications, since new client applications and new versions of existing ones are certainly going to become available. The best way to find out the identification for a particular browser is to set up a cloaked page with an INSERT_CLIENT command, and then access it from the browser in question. The page will then show you exactly what the browser gives as its name. You can also look at your Web server log file to see the identification string for Web browsers used by people visiting your Web site.


Copyright © 1996-1999 Maxum Development Corporation

http://www.maxum.com/
Previous | Next
Contents